<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/layouts/taglib.jsp" %>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>修改APP配置</title>
		<%@ include file="/WEB-INF/layouts/edit-header.jsp" %>

		<style type="text/css">
			.select-input {
				position: absolute;
				top: 0;
				width: 92%;
			}
		</style>
	</head>
	<body>

		<div class="create-page tpanel">
			<div class="panel-content">
				<div class="container-fluid">
			
					<form id="createForm" class="form-horizontal">
						<input type="hidden" name="id" value="${entity.id}" />
					  	<div class="form-group form-group-first">
							<label for="appType" class="col-sm-2 control-label">APP类型</label>
							<div class="col-sm-8">
								<select class="form-control"
										onchange="document.getElementById('appType').value=this.value">
									<option value="" selected>未选择(自定义请自行输入)</option>
									<option value="Common">Common(各平台通用)</option>
									<option value="Android">Android</option>
									<option value="iOS">iOS</option>
									<option value="Windows">Windows</option>
								</select>
								<input type="text" class="form-control select-input" id="appType" name="appType"
									   value="${entity.appType}"
									   placeholder="请输入APP类型(必填)" required maxlength="20"
								/>
							</div>
					  	</div>
						<div class="form-group">
							<label for="name" class="col-sm-2 control-label">配置项</label>
							<div class="col-sm-8">
								<input type="text" class="form-control" id="name" name="name"
                                       value="${entity.name}"
									   placeholder="请输入配置项(必填)" required maxlength="50"
								/>
							</div>
						</div>
						<div class="form-group">
							<label for="value" class="col-sm-2 control-label">配置值</label>
							<div class="col-sm-8">
								<input type="text" id="value" name="value" class="form-control"
                                       value="${entity.value}"
									   placeholder="请输入配置值(必填)" required maxlength="255"/>
							</div>
						</div>
					  	<div class="form-group">
							<div class="col-sm-12" style="text-align: center;">
								<a class="btn btn-default" href="javascript:window.history.back();">返回</a>
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<input type="submit" class="btn btn-primary" value="保存" />
							</div>
					  	</div>
					  	
					</form>
				
				</div>
			</div>
		</div>
		<script type="text/javascript">
            changeTitle('修改APP配置');
            $(function() {
				initForm('#createForm', '${ctx}/admin/app-config/update',function(json) {
					var resp = $.parseJSON(json);
					if(resp.code == 'OK') {
						changeUrl('${ctx}/admin/app-config');
						topLayer.msg('保存成功', {icon: 1});
					}else {
                        topLayer.msg(resp.message, {icon: 2});
					}
				});
			});

		</script>
	</body>
</html>
